package com.ekalenchuk.module.domain.bet;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="bet")
public class Bet implements Serializable {

	private static final long serialVersionUID = -7905556407825334721L;

	private Long id;
	private String title;
	private String description;

	private Participant firstParticipant;
	private Participant secondParticipant;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="id")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name="title")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Lob
	@Column(name="descr")
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@ManyToOne
	@JoinColumn(name="f_partic_id")
	public Participant getFirstParticipant() {
		return firstParticipant;
	}

	public void setFirstParticipant(Participant firstParticipant) {
		this.firstParticipant = firstParticipant;
	}

	@ManyToOne
	@JoinColumn(name="s_partic_id")
	public Participant getSecondParticipant() {
		return secondParticipant;
	}

	public void setSecondParticipant(Participant secondParticipant) {
		this.secondParticipant = secondParticipant;
	}

}
